This program exctracts the sound data from an AIFF file and rewrites it as a text table, with time & amplitude columns. It was especially made for the University, in order to use the output file as a source to Fast Fourier Transform and other applications. The output file is given an extension ".txt".
Due to lack of much time, I designed it to work only with monochanneled AIFF data. Please, tell me if you have such an AIFF file that my program cannot convert, or whether you have any problem while running it.
System Requirements
Any Mac under System 7 or better.
Tech Notes
"AIFF to TEXT Converter" was compiled under CodeWarrior 11. It ilustrates the use of Apple Events (drag & drop), objects (PowerPlant "LFile" and the progress bar) and AIFF dynamic sound format. Although the main code was collected from different sources, I had to correct some mistakes (bad memory allocation, bad prototypes, bad function definitions, etc). Yes, programmers fail a lot, and some research on the "New Inside Macintosh" is essential!
The sprintf() slows down a lot the program, so I added the progress bar class which also allows background processing. The output format is determined by this sprintf(). In this case, it is: time <space> amplitude <return>. The time has 8 decimal digits (you may change it at your pleasure).
As the program reads once all data into memory, you may have to increase the program preferred size at "Get Info" window, in case you get really large sound files.
Distribution
This program is NOT freeware. If it is useful, please send me a postcard. If you write a program using parts of this code, give credits to me. You may freely distribute only the original "AIFF to TEXT Converter" package. Please contact me before including this software in any commercial distribution.
Here is my address:
Zoltan Paulinyi
Caixa Postal 3014
Belo Horizonte ミ MG
CEP 30140-970
BRAZIL
You can send suggestions, bug reports and comments via internet:
Although this program should not make any damage to your system, I give no warranties. Use it at your own risk.
Special Thanks & Credits!
Thanks to the people who makes available useful code over the net. Credits to:
・ MaT101@aol.com (E-Z Progress Bar)
・ Mark & Reed, authors of "Macintosh C Programming Primer" (main code & interface)
・ Apple (Apple Events). Don't trust even on source code available from Apple!
Version History
1.0 ミ First release. Source compiled under CodeWarrior 11 (5/97).
1.1 ミ Recompiled it under new CW Professional 1, and now it is portable to PPC. The cAIFF class had its name changed to the more desciptive cReadAIFF, and I improved the code and comments. Fixed a small bug that caused the output data to be 10 bytes out of phase. Updated my postal address. (7/97).
1.2 ミ Fixed a bug that inverted the wave. All previous files had the signal inverted. Fixed a line in class ProgressBar, which prevented use of float variables (8/97).